const order = require('services/order')
const house = require('services/house')

const register = (job, interval, onetime) => {
  if (!onetime) {
    setInterval(() => {
      job()
    }, interval * 1000)
  }
  job()
}

register(order.cancelExpiredOrders, 60)
register(house.updateImageStructure, null, true)